//
//  JADetailViewController.m
//  网易新闻
//
//  Created by Arvin on 17/3/18.
//  Copyright © 2017年 Arvin. All rights reserved.
//

#import "JADetailViewController.h"
#import "JANetworkTool+News.h"

@interface JADetailViewController ()

@property(nonatomic,strong)UIWebView *webView;

@end

@implementation JADetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //初始化webView
    _webView = [[UIWebView alloc]initWithFrame:self.view.bounds];
    
    //调快滚动速度
    _webView.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;
    
    [self.view addSubview:_webView];
    
    [self loadData];
}

//获取并加载数据
-(void)loadData{
    //获取详情页的数据,并展示
    [[JANetworkTool sharedTool] requestNewsDetail:_model.docid callBack:^(NSString *bodyString) {
        //加载html字符串
        [_webView loadHTMLString:bodyString baseURL:nil];
    }];
}

@end
